import { Button, Tabs, Space, Dropdown, Menu, Input } from 'antd';
import styles from './style.less';
import { connect, Link, history } from 'umi';
import { useEffect, useState } from 'react';

const { TabPane } = Tabs;

const ProjectDoc  = (props) => {

    const {
        projectId,
        projectPermission,
        routeParam,
    } = props;

    useEffect(() => {
        console.log(routeParam)
        if (routeParam.tab){
            setActiveKey(routeParam.tab)
        }
    },[])

    const [activeKey,setActiveKey] = useState();

    const onTabChange = (activeKey) => {
        history.replace(`/projects/${projectId}/${activeKey}`)
        setActiveKey(activeKey)
    }

    return (<div className={styles.docBody}>
    <Tabs activeKey={activeKey} onChange={onTabChange}>
        <TabPane tab="文章" key="article"></TabPane>
        <TabPane tab="Wiki" key="wiki"></TabPane>
        <TabPane tab="知识库" key="knowledge"></TabPane>
    </Tabs>
    </div>)
}

export default ProjectDoc